package com.jsmtr.rms.controller.UserResumeView;

import com.jsmtr.rms.entity.*;
import com.jsmtr.rms.service.DUserResumePreview.IMyhrService;
import com.jsmtr.rms.service.IDoResumeService;
import com.jsmtr.rms.service.IProjectService;
import com.jsmtr.rms.service.IUtilService;
import com.jsmtr.rms.utils.DateTools;
import com.jsmtr.rms.utils.EnumTools;
import com.jsmtr.rms.utils.ResultBean;
import com.jsmtr.rms.utils.StringTools;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 应聘者简历发布前预览控制
 * @author: cyx
 * @description:
 * @date: Created in 2019/2/15 11:51
 * @modified by:
 */
@Controller
public class UserResumePreViewController {
    @Resource
    private IDoResumeService doResumeService;
    @Resource
    private IMyhrService myhrService;


    //region [start] 我的应聘
    @RequestMapping("/UserResume/PreView")
    public String PreView(HttpServletRequest request, Model model) {
        String servletPath=request.getServletPath();
        String pid=request.getParameter("proid");
        String cardNo=request.getParameter("cardno");
        String loginType="";
        boolean isZGZCJ = false;
        if(pid.toLowerCase().indexOf("b_")>=0){
            loginType="GX";
        }else if(pid.toLowerCase().indexOf("c_")>=0 || pid.toLowerCase().indexOf("e_")>=0){
            loginType="ZGZ";
            if(pid.toLowerCase().indexOf("e_")>=0) {
                isZGZCJ = true;//默认春季
            }
        }else if(pid.toLowerCase().indexOf("a_")>=0){
            loginType="SZ";
        }
        try {
            model.addAttribute("path", request.getContextPath());
            //HRUsers usr = utilService.getSessionUser(request);
           /* String pid=request.getParameter("proid");
            String cardNo=request.getParameter("cardno");*/
            List<DUserResume> dUserResumeList=doResumeService.getDResumeByCardNoAllState(cardNo,pid);
            DUserResume dUserResume=null;
            String eresume = "";
            StringBuilder pros = new StringBuilder();
            StringBuilder buttons=new StringBuilder();
            StringBuilder usercard=new StringBuilder();

            //region 先判断是否投递简历或是否已放弃
            if(dUserResumeList==null||dUserResumeList.size()<1){
                pros.append(createNoResumeCards());
                model.addAttribute("result", pros);
                return "/Do/UserResume/ResumePreView/"+loginType+"/index";
            }else if(dUserResumeList.size()>=1){
                dUserResume=dUserResumeList.get(0);
            }

            if(dUserResume!=null){
                if(dUserResume.getFqstate().equalsIgnoreCase("已放弃")){
                    pros.append(createUserGiveUpCards(DateTools.toLenStr(dUserResume.getFqdate())));
                    model.addAttribute("proname",dUserResume.getProname());
                    model.addAttribute("proid",dUserResume.getProid());
                    model.addAttribute("jid",dUserResume.getJid());
                    model.addAttribute("jname",dUserResume.getJname());
                    model.addAttribute("userid",dUserResume.getId());
                    model.addAttribute("result", pros);
                    return "/Do/UserResume/ResumePreView/"+loginType+"/index";
                }
            }
            //endregion

            //修改简历链接
            List<ProjectInfoFlow> projectInfos=myhrService.getProjectInfoFlows(pid,null);
               /* for (int i = 0; i <projectInfos.size() ; i++) {
                    ProjectInfoFlow projectInfo=projectInfos.get(i);
                }*/

            if (loginType.equalsIgnoreCase("SZ")||loginType.equalsIgnoreCase("GX")){
                List<Map<String,Object>> flowinfos;
                if(loginType.equalsIgnoreCase("GX")){
                    flowinfos=myhrService.getDUserResumeFlowInfos(dUserResume.getCardno(),"B");
                }else{
                    flowinfos=myhrService.getDUserResumeFlowInfos(dUserResume.getCardno(),"A");
                }


                if (flowinfos.size()>0){
                    String proname=flowinfos.get(0).get("FLOWPRONAME").toString();
                    String proid=flowinfos.get(0).get("FLOWPROID").toString();
                    String jid=flowinfos.get(0).get("JID").toString();
                    String jname=flowinfos.get(0).get("JNAME").toString();
                    String userid=flowinfos.get(0).get("DUSERID").toString();
                    model.addAttribute("proname",proname);
                    model.addAttribute("proid",proid);
                    model.addAttribute("userid",userid);
                    model.addAttribute("jid",jid);
                    model.addAttribute("jname",jname);


                    //创建用户按钮
                    buttons.append(createUserButtons(userid));
                    for (Map<String, Object> flowinfo : flowinfos) {
                        String time_i="<i class=\"layui-icon layui-icon-circle-dot layui-timeline-axis\"></i>";
                        String time_iw="<i class=\"layui-icon layui-anim layui-anim-rotate layui-anim-loop layui-timeline-axis\"></i>";
                        String flowState=flowinfo.get("FLOWSTATE")==null?"":flowinfo.get("FLOWSTATE").toString();
                        String flowId=flowinfo.get("FLOWID")==null?"":flowinfo.get("FLOWID").toString();
                        String flowNumber=flowinfo.get("FLOWNUMBER")==null?"":flowinfo.get("FLOWNUMBER").toString();
                        String flowName=flowinfo.get("FLOWNAME")==null?flowinfo.get("FLOWNICKNAME").toString():flowinfo.get("FLOWNAME").toString();
                        String webName=flowinfo.get("FLOWWEBNAME")==null?"":flowinfo.get("FLOWWEBNAME").toString();
                        String display=flowinfo.get("DISPLAY")==null?"是":flowinfo.get("DISPLAY").toString();
                        Object resumecontent=flowinfo.get("RESUMECONTENT");
                        if (!StringTools.trimNotEmpty(webName)){
                            if(flowName.equalsIgnoreCase("政审")||flowName.equalsIgnoreCase("背景调查")) {
                                webName = "面试";
                            }else {
                                webName = flowName;
                            }
                        }

                        if (resumecontent!=null){
                            JSONObject contentObject = JSONObject.fromObject(resumecontent);
                                if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.面试.name())&&contentObject.get("fbzt").toString().equals("已公布")) {//面试环节判断是否需要确认
                                    pros.append("<li class=\"layui-timeline-item\">");
                                    if (resumecontent == null || resumecontent.toString().equalsIgnoreCase("")) {
                                        pros.append(time_iw);
                                    } else {
                                        pros.append(time_i);
                                    }
                                    pros.append("<div class=\"layui-timeline-content layui-text\" id=\"" + flowinfo.get("FLOWID") + "\">");
                                    pros.append("<div class=\"layui-timeline-title\">" + webName + "</div>");

                                    StringBuffer contentBuffer = null;
                                    try {
                                        contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                    } catch (Exception e) {
                                        e.printStackTrace();
                                    }
                                    pros.append(contentBuffer);

                                    StringBuffer zysxBuffer = createUserCards(userid, proid, flowId);
                                    if (zysxBuffer != null && zysxBuffer.length() > 0 &&contentObject.get("fbzt").toString().equals("已公布")) {
                                        pros.append(zysxBuffer);
                                    }
                                    Object endTime = contentObject.get("endtime");
                                    Object isconfirm = contentObject.get("isconfirm");
                                    if (StringTools.trimNotEmpty(endTime)) {
                                        List<Map<String, Object>> doMSUserList = myhrService.getMsUserDetialByMap(flowId, userid);
                                        if (doMSUserList.size() == 1) {
                                            Map doMSUser = doMSUserList.get(0);
                                            if (doMSUser != null) {
                                                model.addAttribute("msconfrimid", doMSUser.get("CONFRIMID"));
                                            }
                                            StringBuffer confirmBuffer = createUserMSConfirmCards(userid, proid, flowId, endTime, isconfirm);
                                            if (confirmBuffer != null && confirmBuffer.length() > 0) {
                                                pros.append(confirmBuffer);
                                            }
                                        }
                                    }
                                    pros.append("</div>");
                                    pros.append("</li>");
                                }else if(flowName.equalsIgnoreCase("背景调查")||flowName.equalsIgnoreCase("政审")){
                                    int lindex= pros.lastIndexOf("</div></li>");
                                    //pros.substring(0,pros.length()-11);
                                    pros.replace(lindex,pros.length(),"");
                                    StringBuffer contentBuffer = null;
                                    try {
                                        for (Map<String, Object> tflowinfo : flowinfos) {
                                            String tflowName=tflowinfo.get("FLOWNAME")==null?tflowinfo.get("FLOWNICKNAME").toString():tflowinfo.get("FLOWNAME").toString();
                                            String tflowId=tflowinfo.get("FLOWID")==null?"":flowinfo.get("FLOWID").toString();
                                            String tflowNumber=tflowinfo.get("FLOWNUMBER")==null?"":flowinfo.get("FLOWNUMBER").toString();
                                            Object tresumecontent=tflowinfo.get("RESUMECONTENT");
                                            if(tflowName.equalsIgnoreCase("面试")){
                                                contentBuffer = createGXUserFlowInfo(tflowNumber, tflowId, tflowName, tresumecontent);
                                                break;
                                            }

                                        }
                                        //contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                    } catch (Exception e) {
                                        e.printStackTrace();
                                    }
                                    pros.append(contentBuffer);
                                    pros.append("</div>");
                                    pros.append("</li>");
                                }else{
                                    if(contentObject.get("fbzt").toString().equals("已公布")) {
                                        pros.append("<li class=\"layui-timeline-item\">");
                                        if (resumecontent == null || resumecontent.toString().equalsIgnoreCase("")) {
                                            pros.append(time_iw);
                                        } else {
                                            pros.append(time_i);
                                        }
                                        pros.append("<div class=\"layui-timeline-content layui-text\" id=\"" + flowinfo.get("FLOWID") + "\">");
                                        pros.append("<div class=\"layui-timeline-title\">" + webName + "</div>");
                                        StringBuffer contentBuffer = null;
                                        try {
                                            contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                        } catch (Exception e) {
                                            e.printStackTrace();
                                        }
                                        pros.append(contentBuffer);
                                        pros.append("</div>");
                                        pros.append("</li>");
                                    }else if (flowId.equalsIgnoreCase(projectInfos.get(0).getId())){
                                        pros.append("<li class=\"layui-timeline-item\">");
                                        if (resumecontent == null || resumecontent.toString().equalsIgnoreCase("")) {
                                            pros.append(time_iw);
                                        } else {
                                            pros.append(time_i);
                                        }
                                        pros.append("<div class=\"layui-timeline-content layui-text\" id=\"" + flowinfo.get("FLOWID") + "\">");
                                        pros.append("<div class=\"layui-timeline-title\">" + webName + "</div>");
                                        StringBuffer contentBuffer = null;
                                        try {
                                            contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                        } catch (Exception e) {
                                            e.printStackTrace();
                                        }
                                        pros.append(contentBuffer);
                                        pros.append("</div>");
                                        pros.append("</li>");
                                    }
                                }
                        }
                    }
                    if (pros.length()<=0){
                        pros.append("<div class=\"layui-timeline-content layui-text\">招聘流程进行中请耐心等待!</div>");
                    }
                }else{
                    pros.append("<div class=\"layui-timeline-content layui-text\">本次应聘尚未投递简历,请先投递简历!</div>");
                }
            }
            if(loginType.equalsIgnoreCase("ZGZ")) {
                if (isZGZCJ) {
                    List<Map<String,Object>> flowinfos=myhrService.getZGZCJDUserResumeFlowInfos(dUserResume.getCardno());
                    if (flowinfos.size()>0){
                        String proname=flowinfos.get(0).get("FLOWPRONAME").toString();
                        String proid=flowinfos.get(0).get("FLOWPROID").toString();
                        String jid=flowinfos.get(0).get("JID").toString();
                        String jname=flowinfos.get(0).get("JNAME").toString();
                        String userid=flowinfos.get(0).get("DUSERID").toString();
                        model.addAttribute("proname",proname);
                        model.addAttribute("proid",proid);
                        model.addAttribute("userid",userid);
                        model.addAttribute("jid",jid);
                        model.addAttribute("jname",jname);


                        //创建用户按钮
                        buttons.append(createUserButtons(userid));
                        for (Map<String, Object> flowinfo : flowinfos) {
                            String time_i="<i class=\"layui-icon layui-icon-circle-dot layui-timeline-axis\"></i>";
                            String time_iw="<i class=\"layui-icon layui-anim layui-anim-rotate layui-anim-loop layui-timeline-axis\"></i>";
                            String flowState=flowinfo.get("FLOWSTATE")==null?"":flowinfo.get("FLOWSTATE").toString();
                            String flowId=flowinfo.get("FLOWID")==null?"":flowinfo.get("FLOWID").toString();
                            String flowNumber=flowinfo.get("FLOWNUMBER")==null?"":flowinfo.get("FLOWNUMBER").toString();
                            String flowName=flowinfo.get("FLOWNAME")==null?flowinfo.get("FLOWNICKNAME").toString():flowinfo.get("FLOWNAME").toString();
                            String webName=flowinfo.get("FLOWWEBNAME")==null?"":flowinfo.get("FLOWWEBNAME").toString();
                            String display=flowinfo.get("DISPLAY")==null?"是":flowinfo.get("DISPLAY").toString();
                            Object resumecontent=flowinfo.get("RESUMECONTENT");
                            if (!StringTools.trimNotEmpty(webName)){
                                if(flowName.equalsIgnoreCase("政审")||flowName.equalsIgnoreCase("背景调查")) {
                                    webName = "面试";
                                }else {
                                    webName = flowName;
                                }
                            }
                            if (resumecontent!=null){
                                JSONObject contentObject = JSONObject.fromObject(resumecontent);
                                    if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.面试.name())&&contentObject.get("fbzt").toString().equals("已公布")) {//面试环节判断是否需要确认
                                        pros.append("<li class=\"layui-timeline-item\">");
                                        if (resumecontent == null || resumecontent.toString().equalsIgnoreCase("")) {
                                            pros.append(time_iw);
                                        } else {
                                            pros.append(time_i);
                                        }
                                        pros.append("<div class=\"layui-timeline-content layui-text\" id=\"" + flowinfo.get("FLOWID") + "\">");
                                        pros.append("<div class=\"layui-timeline-title\">" + webName + "</div>");

                                        StringBuffer contentBuffer = null;
                                        try {
                                            contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                        } catch (Exception e) {
                                            e.printStackTrace();
                                        }
                                        pros.append(contentBuffer);

                                        StringBuffer zysxBuffer = createUserCards(userid, proid, flowId);
                                        if (zysxBuffer != null && zysxBuffer.length() > 0 && contentObject.get("fbzt").toString().equals("已公布")) {
                                            pros.append(zysxBuffer);
                                        }
                                        Object endTime = contentObject.get("endtime");
                                        Object isconfirm = contentObject.get("isconfirm");
                                        if (StringTools.trimNotEmpty(endTime)) {
                                            List<Map<String, Object>> doMSUserList = myhrService.getMsUserDetialByMap(flowId, userid);
                                            if (doMSUserList.size() == 1) {
                                                Map doMSUser = doMSUserList.get(0);
                                                if (doMSUser != null) {
                                                    model.addAttribute("msconfrimid", doMSUser.get("CONFRIMID"));
                                                }
                                                StringBuffer confirmBuffer = createUserMSConfirmCards(userid, proid, flowId, endTime, isconfirm);
                                                if (confirmBuffer != null && confirmBuffer.length() > 0) {
                                                    pros.append(confirmBuffer);
                                                }
                                            }
                                        }
                                        pros.append("</div>");
                                        pros.append("</li>");
                                    }else if(flowName.equalsIgnoreCase("背景调查")||flowName.equalsIgnoreCase("政审")){
                                        int lindex= pros.lastIndexOf("</div></li>");
                                        //pros.substring(0,pros.length()-11);
                                        pros.replace(lindex,pros.length(),"");
                                        StringBuffer contentBuffer = null;
                                        try {
                                            contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                        } catch (Exception e) {
                                            e.printStackTrace();
                                        }
                                        pros.append(contentBuffer);
                                        pros.append("</div>");
                                        pros.append("</li>");
                                    }else{
                                        if(contentObject.get("fbzt").toString().equals("已公布")) {
                                            pros.append("<li class=\"layui-timeline-item\">");
                                            if (resumecontent == null || resumecontent.toString().equalsIgnoreCase("")) {
                                                pros.append(time_iw);
                                            } else {
                                                pros.append(time_i);
                                            }
                                            pros.append("<div class=\"layui-timeline-content layui-text\" id=\"" + flowinfo.get("FLOWID") + "\">");
                                            pros.append("<div class=\"layui-timeline-title\">" + webName + "</div>");
                                            StringBuffer contentBuffer = null;
                                            try {
                                                contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                            } catch (Exception e) {
                                                e.printStackTrace();
                                            }
                                            pros.append(contentBuffer);
                                            pros.append("</div>");
                                            pros.append("</li>");
                                        }else if (flowId.equalsIgnoreCase(projectInfos.get(0).getId())){
                                            pros.append("<li class=\"layui-timeline-item\">");
                                            if (resumecontent == null || resumecontent.toString().equalsIgnoreCase("")) {
                                                pros.append(time_iw);
                                            } else {
                                                pros.append(time_i);
                                            }
                                            pros.append("<div class=\"layui-timeline-content layui-text\" id=\"" + flowinfo.get("FLOWID") + "\">");
                                            pros.append("<div class=\"layui-timeline-title\">" + webName + "</div>");
                                            StringBuffer contentBuffer = null;
                                            try {
                                                contentBuffer = createUserFlowInfo(flowNumber, flowId, flowName, resumecontent);
                                            } catch (Exception e) {
                                                e.printStackTrace();
                                            }
                                            pros.append(contentBuffer);
                                            pros.append("</div>");
                                            pros.append("</li>");
                                        }
                                    }

                            }
                        }

                        if (pros.length()<=0){
                            pros.append("<div class=\"layui-timeline-content layui-text\">招聘流程进行中请耐心等待!</div>");
                        }
                    }else{
                        pros.append("<div class=\"layui-timeline-content layui-text\">本次应聘尚未投递简历,请先投递简历!</div>");
                    }
                } else {
                    //region [start] 中专校园招聘
                    List<HRZZUser> zzusers = myhrService.getZZUsers(dUserResume.getCardno());
                    for (HRZZUser zzuser : zzusers) {
                        StringBuilder str = new StringBuilder();
                        ProjectInfoFlow flow = myhrService.getProjectInfoFlow(zzuser.getFid());
                        List<ProjectInfoFlow> projectInfoFlowList = myhrService.getProjectInfoFlows(zzuser.getPid(), null);

                        if (zzuser.getFqstate().equals("已放弃")) {
                            str.append("<li class='hotitem'>你已放弃本次应聘</li>");
                        } else {
                            //放弃按钮是否显示
                            boolean giveupbtn = false;
                            String msfid = null;

                            for (ProjectInfoFlow projectInfoFlow : projectInfoFlowList) {
                                if (projectInfoFlow.getState() == 1) {

                            /*if (projectInfoFlow.getFid().equals(flow.getFid())){
                                str.append("<li class='hotitem'>当前状态：" + flow.getNickname() + "</li>");
                            }*/
                            /*else{
                                str.append("<li class='hotitem'>" + flow.getNickname() + "</li>");
                            }*/
                                    if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.毕业生推荐.ordinal()) {
                                        //if (zzuser.getOp1().equals("已公布")) {
                                        str.append("<li>个人信息:" + EnumTools.zzuserState.values()[zzuser.getState()] + "</li>");
                                        if (!zzuser.getRstate().equalsIgnoreCase("未处理")) {
                                            str.append("<li>简历筛选:" + zzuser.getRstate() + "</li>");
                                            if (zzuser.getRmarks() != null && !zzuser.getRmarks().equalsIgnoreCase("")) {
                                                str.append("<br>备注：" + zzuser.getRmarks());
                                            }
                                        }
                                        // }
                                    }
                                    if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.初审.ordinal()) {
                                        if (zzuser.getOp1().equals("已公布")) {
                                            str.append("<li>初审" + EnumTools.zzuserState.values()[zzuser.getState()] + "</li>");
                                        }
                                        //20190107 面试与背景调查合并,面试环节不在发布,背景调查环节统一发布
                                    } else if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.面试.ordinal()) {
                                        msfid = projectInfoFlow.getId();
                                    } else if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.投简历.ordinal()) {
                                        str.append("<li>" + zzuser.getRstate() + "</li>");

                                        if (zzuser.getRstate().equals("未投简历")) {
                                            str.append("<li><div class='btnbar'><form id='Validform' method='post' action='" + request.getContextPath() + "/Job/ZZSendAction'>");
                                            str.append("<button type='submit'>马上投简历</button><input type='hidden' name='id' value='" + zzuser.getPid() + "' /></form></div></li>");
                                        } else {
                                            eresume = "<a target='_blank' style='float:right;color:red;' href='" + request.getContextPath() + "/Resume/Edit?type=zz&id=" + zzuser.getId() + "'>修改简历</a>";
                                        }
                                        giveupbtn = true;
                                        //20190107 面试与背景调查合并,面试环节不在发布,背景调查环节统一发布
                                    } else if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.背景调查.ordinal() && zzuser.getPath().indexOf(msfid) > 0) {
                                        DoMSUser doMSUser = myhrService.getMsUser(msfid, zzuser.getId());
                                        if (zzuser.getOp4().equals("已公布")) {
                                            if (zzuser.getZsstate().equalsIgnoreCase("已通过") || zzuser.getZsstate().equalsIgnoreCase("通过") || zzuser.getZsstate().equalsIgnoreCase("合格")) {
                                                str.append("<li>面试" + zzuser.getZsstate() + "</li>");
                                            } else if (zzuser.getZsstate().equalsIgnoreCase("未通过") || zzuser.getZsstate().equalsIgnoreCase("不通过") || zzuser.getZsstate().equalsIgnoreCase("不合格")) {
                                                str.append("<li>面试" + zzuser.getZsstate() + "</li>");
                                            }
                                       /* if (zzuser.getMsstate().equalsIgnoreCase("已通过") && zzuser.getZsstate().equalsIgnoreCase("已通过")) {
                                            str.append("<li>面试" + zzuser.getZsstate() + "</li>");
                                        } else if (zzuser.getMsstate().equalsIgnoreCase("未通过") && zzuser.getZsstate().equalsIgnoreCase("已通过")) {
                                            str.append("<li>面试" + zzuser.getMsstate() + "</li>");
                                        } else if (zzuser.getZsstate().equalsIgnoreCase("未通过")) {
                                            str.append("<li>面试" + zzuser.getZsstate() + "</li>");
                                        } else if (zzuser.getMsstate().equalsIgnoreCase("未面试")) {
                                            str.append("<li>未参加面试</li>");
                                        }*/
                                        } else {
                                            if (doMSUser != null && doMSUser.getPoint() != null) {
                                                if (doMSUser.getResult().equalsIgnoreCase("已通过") || doMSUser.getResult().equalsIgnoreCase("通过") || doMSUser.getResult().equalsIgnoreCase("合格")) {
                                                    //  str.append("<li>面试" + zzuser.getZsstate() + "</li>");
                                                } else if (doMSUser.getResult().equalsIgnoreCase("不通过") || doMSUser.getResult().equalsIgnoreCase("未通过")) {
                                                    str.append("<li>面试" + doMSUser.getResult() + "</li>");
                                                } else if (doMSUser.getResult().equalsIgnoreCase("未面试") || doMSUser.getResult().equalsIgnoreCase("未参加")) {
                                                    str.append("<li>面试" + doMSUser.getResult() + "</li>");
                                                }
                                            }
                                        }

                                    } else if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.体检.ordinal() && zzuser.getPath().indexOf(projectInfoFlow.getId()) > 0) {
                                        if (zzuser.getTjstate().equals("未体检")) {
                                            if (zzuser.getTjaddress() == null) {
                                                str.append("<li class='hotitem'>正在安排体检</li>");
                                            } else {
                                                str.append("<li class='hotitem'>");
                                                str.append(zzuser.getTjstate() + "<br>" + "体检时间：" + zzuser.getTjtime() + "<br>");
                                                str.append("体检地点：" + zzuser.getTjaddress());
                                                if (zzuser.getTjlxr() != null) {
                                                    str.append("<br>联 系 人：" + zzuser.getTjlxr() + "&emsp;联系电话：" + zzuser.getTjlxdh());
                                                }
                                                str.append("</li>");
                                            }
                                   /* str.append("<li class='hotitem'>");
                                    if (zzuser.getTjmsg().equals("已发通知")) {
                                        str.append(zzuser.getTjstate() + "体检时间：" + zzuser.getTjtime() + "<br>");
                                        str.append("体检地点：" + zzuser.getTjaddress());
                                        if (zzuser.getTjlxr() != null) {
                                            str.append("<br>联 系 人：" + zzuser.getTjlxr() + "&emsp;联系电话：" + zzuser.getTjlxdh());
                                        }
                                        str.append("</li>");
                                    } else {
                                        str.append("正在安排体检</li>");
                                    }*/
                                        } else {
                                            if (zzuser.getOp5().equals("已公布")) {
                                                if (zzuser.getTjremark() != null && !zzuser.getTjremark().equalsIgnoreCase("")) {
                                                    str.append("<li>体检" + zzuser.getTjstate() + "<br/>备注：" + zzuser.getTjremark() + "</li>");
                                                } else {
                                                    str.append("<li>体检" + zzuser.getTjstate() + "</li>");
                                                }
                                            }
                                        }
                                        if (!zzuser.getTjstate().equals("不合格")) {

                                            giveupbtn = true;
                                        }
                                    } else if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.实习.ordinal() && zzuser.getPath().indexOf(projectInfoFlow.getId()) > 0) {
                                        if (zzuser.getOp7().equals("已公布")) {
                                            str.append("<li>实习" + zzuser.getSxstate() + "</li>");
                                        }
                                        if (!zzuser.getSxstate().equals("未通过")) {
                                            giveupbtn = true;
                                        }
                                    } else if (projectInfoFlow.getFid() == EnumTools.ZZFlowState.录用.ordinal() && zzuser.getPath().indexOf(projectInfoFlow.getId()) > 0) {
                                        /*if (zzuser.getBdmsg().equals("已发通知")) {
                                            if (zzuser.getBdstate().equals("已报到")) {
                                                str.append("<li>报到" + zzuser.getBdstate() + "</li>");
                                            } else {
                                                str.append("<li class='hotitem'>报到时间：" + zzuser.getBdtime() + "<br>");
                                                str.append("报到地点：" + zzuser.getBdaddress());
                                                if (zzuser.getBdlxr() != null) {
                                                    str.append("<br>联 系 人：" + zzuser.getBdlxr() + "&emsp;联系电话：" + zzuser.getBdlxdh());
                                                }
                                                str.append("</li>");
                                            }
                                        } else {

                                            str.append("<li class='hotitem'>正在安排报到</li>");
                                        }*/
                                        if (zzuser.getOp8().equals("已公布")) {
                                            str.append("<li>报到" + zzuser.getBdstate() + "</li>");
                                        }
                                        if (!zzuser.getBdstate().equals("已报到")) {
                                            giveupbtn = true;
                                        }
                                    }
                                }
                            }

                /*    if (giveupbtn) {
                        str.append("<li><div class='btnbar'>");
                        str.append("<form id='giveupValid' method='post' action='" + request.getContextPath() + "/Myhr/GiveUpZZ'>");

                        str.append("<input type='hidden' name='pid' value='" + zzuser.getPid() + "' />");
                        str.append("<table class='treeTable inputform'><tbody>");
                        str.append("<tr><td width='70'>验 证 码：</td><td width='110' style='border-right:none;'>");
                        str.append("<input type='text' class='valiCode' name='vcode' datatype='*' nullmsg='验证码不能为空！' />");
                        str.append("</td><td width='100'><img  style='width:100px;height:30px;' src='" + request.getContextPath() + "/resources/captcha.jpeg' title='点击刷新' onClick='refushCode(this)'/></td>");
                        str.append("<td><button type='submit' class='orange'>放弃本次应聘</button></td></tr>");
                        str.append("</tbody></table></form></div></li>");
                    }*/
                        }
                        pros.append("<div class='bar'><div class='title active'>【" + zzuser.getPname() + "】 " + zzuser.getJob() + "</div>");
                        pros.append("<div class='btn'><button type='button' class='show' onFocus='blur()'></button></div>");
                        pros.append("<div class='clear'></div></div><div class='listcont' style='display: block;'><ul style='width:570px;float:left;'>" + str + "</ul>");

                        if (zzuser.getRstate().equals("已投简历")) {
                            pros.append("<a target='_blank' style='float:right;color:red;' href='" + request.getContextPath() + "/Myhr/Application?id=" + zzuser.getId() + "'>打印职位申请表</a><br>" + eresume);
                        }

                        pros.append("<p style='clear:both;'></p></div>");
                    }

                    //endregion  [end]
                }
            }
            model.addAttribute("result", pros);
            model.addAttribute("buttons",buttons);
        } catch (Exception e) {
            e.printStackTrace();
        }
        model.addAttribute("logintype",loginType);
        return "/Do/UserResume/ResumePreView/"+loginType+"/index";
    }
    //endregion [end]

    //region 创建用户招聘流程信息
    public  StringBuffer createGXUserFlowInfo(String flownumber,String flowid,String flowname,Object resumecontent) throws Exception{
        StringBuffer contenttext=new StringBuffer();
        if (resumecontent!=null){
            try {
                JSONObject contentObject = JSONObject.fromObject(resumecontent);
                if(contentObject.get("fbzt").toString().equals("已公布")|(contentObject.get("msg")!=null&&contentObject.get("msg").equals("0"))){
                    if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.笔试.name())){
                        contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                        contenttext.append(flowname+"考场:"+contentObject.get("name")+"<br/>");
                        contenttext.append(flowname+"准考证号:"+contentObject.get("ticketnum")+"<br/>");
                    }else if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.面试.name())){
                     /*   contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                        contenttext.append(flowname+"是否确认:"+contentObject.get("isconfirm")+"<br/>");
                        contenttext.append(flowname+"确认时间:"+contentObject.get("confirmtime")+"<br/>");*/
                    }else if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.实作.name())){
                        contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                        contenttext.append(flowname+"内容:"+contentObject.get("name")+"<br/>");
                    }else if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.体检.name())){
                        contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                    }
                    if(flowname.equalsIgnoreCase("背景调查")||flowname.equalsIgnoreCase("政审")){
                        //contenttext.append("面试结果:"+contentObject.get("state")+"<br/>");
                        /* contenttext.append("面试备注:"+contentObject.get("remark")+"<br/>");*/
                    }else if(flowname.equalsIgnoreCase("面试")){
                        contenttext.append("面试结果:"+contentObject.get("state")+"<br/>");
                    }else if(flowname.equalsIgnoreCase("简历筛选")){
                        contenttext.append(flowname + "结果:" + contentObject.get("state") + "<br/>");
                    }else{
                        contenttext.append(flowname + "结果:" + contentObject.get("state") + "<br/>");
                        if(flowname.equalsIgnoreCase("体检")) {
                            contenttext.append(flowname + "备注:" + contentObject.get("remark") + "<br/>");
                        }
                    }

                }else{
                    if(!contentObject.get("fbzt").toString().equals("已公布")&&(flowname.equalsIgnoreCase("背景调查")||flowname.equalsIgnoreCase("政审"))){
                        //contenttext.append("面试流程进行中请耐心等待结果..<br/>");
                    }else{
                        contenttext.append(flowname+"流程进行中请耐心等待结果..<br/>");
                    }

                }
            }catch (Exception e){
                throw new Exception("流程内容转型失败!");
            }
        }else{
            contenttext.append("<div>招聘流程进行中请耐心等待..</div>");
        }
        return  contenttext;
    }
    //endregion

    //region 创建用户招聘流程信息
    public  StringBuffer createUserFlowInfo(String flownumber,String flowid,String flowname,Object resumecontent) throws Exception{
        StringBuffer contenttext=new StringBuffer();
        if (resumecontent!=null){
            try {
                JSONObject contentObject = JSONObject.fromObject(resumecontent);
                if(contentObject.get("fbzt").toString().equals("已公布")|(contentObject.get("msg")!=null&&contentObject.get("msg").equals("0"))){
                    if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.笔试.name())){
                        contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                        contenttext.append(flowname+"考场:"+contentObject.get("name")+"<br/>");
                        contenttext.append(flowname+"准考证号:"+contentObject.get("ticketnum")+"<br/>");
                    }else if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.面试.name())){
                        contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                        contenttext.append(flowname+"是否确认:"+contentObject.get("isconfirm")+"<br/>");
                        contenttext.append(flowname+"确认时间:"+contentObject.get("confirmtime")+"<br/>");
                    }else if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.实作.name())){
                        contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                        contenttext.append(flowname+"内容:"+contentObject.get("name")+"<br/>");
                    }else if(flowname.equalsIgnoreCase(EnumTools.FlowNomalState.体检.name())){
                        contenttext.append(flowname+"地点:"+contentObject.get("address")+"<br/>");
                        contenttext.append(flowname+"时间:"+contentObject.get("time")+"<br/>");
                    }
                    if(flowname.equalsIgnoreCase("背景调查")||flowname.equalsIgnoreCase("政审")){
                        contenttext.append("面试结果:"+contentObject.get("state")+"<br/>");
                       /* contenttext.append("面试备注:"+contentObject.get("remark")+"<br/>");*/
                    }else if(flowname.equalsIgnoreCase("面试")){

                    }else if(flowname.equalsIgnoreCase("简历筛选")){
                        contenttext.append(flowname + "结果:" + contentObject.get("state") + "<br/>");
                    }else{
                        contenttext.append(flowname + "结果:" + contentObject.get("state") + "<br/>");
                        if(flowname.equalsIgnoreCase("体检")) {
                            contenttext.append(flowname + "备注:" + contentObject.get("remark") + "<br/>");
                        }
                    }

                }else{
                    if(!contentObject.get("fbzt").toString().equals("已公布")&&(flowname.equalsIgnoreCase("背景调查")||flowname.equalsIgnoreCase("政审"))){
                        //contenttext.append("面试流程进行中请耐心等待结果..<br/>");
                    }else{
                        contenttext.append(flowname+"流程进行中请耐心等待结果..<br/>");
                    }

                }
            }catch (Exception e){
                throw new Exception("流程内容转型失败!");
            }
        }else{
            contenttext.append("<div>招聘流程进行中请耐心等待..</div>");
        }
        return  contenttext;
    }
    //endregion

    //region 创建用户按钮
    public StringBuffer createUserButtons(String userid) throws Exception {
        StringBuffer buttons=new StringBuffer();
        try {
            DUserResume userResume=doResumeService.getDUserResume(userid);


            ProjectInfoFlow nowFlow=myhrService.getProjectInfoFlow(userResume.getFid());
            String flowname=nowFlow.getFname()==null?nowFlow.getNickname():nowFlow.getFname();
            if(userResume!=null){
                if (flowname.equalsIgnoreCase(EnumTools.FlowNomalState.简历筛选.name())||flowname.equalsIgnoreCase(EnumTools.FlowNomalState.资料审核.name())){ //简历筛选或资料审核阶段生成修改简历按钮
                    // buttons.append(" <button class=\"layui-btn layui-btn-normal layui-btn-sm\" id=\"btn_EditResume\" style=\"margin-top: 10px;\" >更新简历</button>");
                }else if (flowname.equalsIgnoreCase(EnumTools.FlowNomalState.笔试.name())){ //笔试阶段如有准考证生成打印准考证按钮
                    DoBSUser bsUser = myhrService.getBsUser(nowFlow.getId(), userResume.getId());
                    if(bsUser!=null){
                        if (bsUser.getResult().equals("-")) {
                            buttons.append(" <button class=\"layui-btn layui-btn-sm\" id=\"btn_PrintTickNum\" style=\"margin-top: 10px;\" onclick=\"Print('/Myhr/Print?id=" + bsUser.getId() + "')\">打印准考证</button>");
                        }
                    }

                }
            }
            if (userResume.getFqstate().equalsIgnoreCase("已放弃")){
                buttons.append(" <button  class=\"layui-btn layui-btn-disabled layui-btn-sm\" style=\"margin-top: 10px;\">你已放弃本次应聘</button>");
            }else{
                buttons.append(" <button class=\"layui-btn layui-btn-sm\" id=\"btn_printJobApply\" style=\"margin-top: 10px;\">打印职位申请表</button>");
                buttons.append(" <button  class=\"layui-btn layui-btn-danger layui-btn-sm\" style=\"margin-top: 10px;\" id=\"btn_giveup\">放弃本次招聘</button>");

            }
        } catch (Exception e){
            throw new Exception("创建用户按钮失败!");
        }
        return  buttons;
    }
    //endregion

    //region 创建用户注意事项
    public StringBuffer createUserCards(String userid,String proid,String flowid) throws Exception{
        StringBuffer cards=new StringBuffer();
        try {
            Object zysx= myhrService.getUserZysx(proid,flowid,userid);
            if (StringTools.trimNotEmpty(zysx)){
                StringBuffer card=new StringBuffer();
                card.append("<div style=\"padding: 10px; background-color: #F2F2F2;\">");
                card.append("<div class=\"layui-card\">");
                card.append("<div class=\"layui-card-header\">温馨提示</div>");
                card.append(" <div class=\"layui-card-body\">"+zysx+"</div>");
                card.append("</div>");
                card.append("</div>");
                cards.append(card);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return cards;
    }
    //endregion

    //region 创建面试确认卡
    public StringBuffer createUserMSConfirmCards(String userid,String proid,String flowid,Object endtime,Object isconfirm) throws Exception{
        StringBuffer cards=new StringBuffer();
        try{
            if (StringTools.trimNotEmpty(endtime)){

                SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd ss:mm");
                Date sdate=dateFormat.parse(endtime.toString());
                int compareTime=sdate.compareTo(new Date());
                StringBuffer card=new StringBuffer();
                if (compareTime>0&&isconfirm.equals("否")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append("<div class=\"layui-card-header\">温馨提示</div>");
                    SimpleDateFormat cdateFormat=new SimpleDateFormat("yyyy年MM月dd日 ss点mm分");
                    String cfendtime=cdateFormat.format(sdate);
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>请在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前确认参加面试，如未在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前进行确认，则视为自动放弃面试！</div>");
                    card.append(" <div style=\"display:block;height:40px;\"><button class=\"layui-btn layui-btn-normal layui-btn-sm\" id=\"btn_MSConfirm\" style=\"margin-top: 10px;float:right;\" >确认参加面试</button></div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }else if (compareTime>0&&isconfirm.equals("是")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>您已确认参加面试成功,请准时参加面试！</div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }
                cards.append(card);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return cards;
    }
    //endregion

    //region 创建笔试确认卡
    public StringBuffer createUserBSConfirmCards(String userid,String proid,String flowid,Object endtime,Object isconfirm) throws Exception{
        StringBuffer cards=new StringBuffer();
        try{
            if (StringTools.trimNotEmpty(endtime)){

                SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd ss:mm");
                Date sdate=dateFormat.parse(endtime.toString());
                int compareTime=sdate.compareTo(new Date());
                StringBuffer card=new StringBuffer();
                if (compareTime>0&&isconfirm.equals("否")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append("<div class=\"layui-card-header\">温馨提示</div>");
                    SimpleDateFormat cdateFormat=new SimpleDateFormat("yyyy年MM月dd日 ss点mm分");
                    String cfendtime=cdateFormat.format(sdate);
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>请在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前确认参加面试，如未在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前进行确认，则视为自动放弃面试！</div>");
                    card.append(" <div style=\"display:block;height:40px;\"><button class=\"layui-btn layui-btn-normal layui-btn-sm\" id=\"btn_MSConfirm\" style=\"margin-top: 10px;float:right;\" >确认参加面试</button></div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }else if (compareTime>0&&isconfirm.equals("是")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>您已确认参加面试成功,请准时参加面试！</div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }
                cards.append(card);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return cards;
    }
    //endregion


    //region 创建人员转岗确认卡片
    /*
     * 创建人员转岗确认卡片
     * @author cyx
     * @date 2019/2/15 9:32
     * @param userid
     * @param proid
     * @param flowid
     * @param endtime
     * @param isconfirm
     * @return java.lang.StringBuffer
     */
    public StringBuffer createUserChangeJobConfirmCards(String userid,String proid,String flowid,Object endtime,Object isconfirm) throws Exception{
        StringBuffer cards=new StringBuffer();
        try{
            if (StringTools.trimNotEmpty(endtime)){

                SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd ss:mm");
                Date sdate=dateFormat.parse(endtime.toString());
                int compareTime=sdate.compareTo(new Date());
                StringBuffer card=new StringBuffer();
                if (compareTime>0&&isconfirm.equals("否")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append("<div class=\"layui-card-header\">温馨提示</div>");
                    SimpleDateFormat cdateFormat=new SimpleDateFormat("yyyy年MM月dd日 ss点mm分");
                    String cfendtime=cdateFormat.format(sdate);
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>请在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前确认参加面试，如未在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前进行确认，则视为自动放弃面试！</div>");
                    card.append(" <div style=\"display:block;height:40px;\"><button class=\"layui-btn layui-btn-normal layui-btn-sm\" id=\"btn_MSConfirm\" style=\"margin-top: 10px;float:right;\" >确认参加面试</button></div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }else if (compareTime>0&&isconfirm.equals("是")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>您已确认参加面试成功,请准时参加面试！</div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }
                cards.append(card);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return cards;
    }
    //endregion

    //region 创建修改简历确认卡片
    public StringBuffer createUserChangeResumeConfirmCards(String userid,String proid,String flowid,Object endtime,Object isconfirm) throws Exception{
        StringBuffer cards=new StringBuffer();
        try{
            if (StringTools.trimNotEmpty(endtime)){

                SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd ss:mm");
                Date sdate=dateFormat.parse(endtime.toString());
                int compareTime=sdate.compareTo(new Date());
                StringBuffer card=new StringBuffer();
                if (compareTime>0&&isconfirm.equals("否")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append("<div class=\"layui-card-header\">温馨提示</div>");
                    SimpleDateFormat cdateFormat=new SimpleDateFormat("yyyy年MM月dd日 ss点mm分");
                    String cfendtime=cdateFormat.format(sdate);
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>请在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前确认参加面试，如未在<span style=\"font-weight: bolder\">" + cfendtime + "</span>前进行确认，则视为自动放弃面试！</div>");
                    card.append(" <div style=\"display:block;height:40px;\"><button class=\"layui-btn layui-btn-normal layui-btn-sm\" id=\"btn_MSConfirm\" style=\"margin-top: 10px;float:right;\" >确认参加面试</button></div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }else if (compareTime>0&&isconfirm.equals("是")){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2;\">");
                    card.append("<div class=\"layui-card\">");
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>您已确认参加面试成功,请准时参加面试！</div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
                }
                cards.append(card);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return cards;
    }
    //end region


    //region 创建已放弃本次招聘卡片
    public StringBuffer createUserGiveUpCards(String fqdate) {
        StringBuffer card=new StringBuffer();
            if (StringTools.trimNotEmpty(fqdate)){
                    card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2; color:red; \">");
                    card.append("<div class=\"layui-card\">");
                    card.append(" <div class=\"layui-card-body\">");
                    card.append("<div>您已于"+ fqdate+"，放弃本次应聘！</div>");
                    card.append("</div>");
                    card.append("</div>");
                    card.append("</div>");
            }
        return card;
    }
    //endregion

    //region 创建为投递简历卡片
    public StringBuffer createNoResumeCards(){
        StringBuffer card=new StringBuffer();
        card.append("<div style=\"padding: 10px;margin-top:10px; background-color: #F2F2F2; color:red; \">");
        card.append("<div class=\"layui-card\">");
        card.append(" <div class=\"layui-card-body\">");
        card.append("<div>本次应聘尚未投递简历，请先投递简历！</div>");
        card.append("</div>");
        card.append("</div>");
        card.append("</div>");
        return card;
    }
    //endregion


}
